﻿#region Librerias

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using ESF.General;
using System.IO;
using ESF.Web.ServerControls;
using ESF.General.Entity;

#endregion


namespace ESF.Web.Pages
{
	public abstract class BaseShowContentDirPage : BasePage
	{
		#region Miembros
		
		GenericTreeView _TreeView;

		#endregion


		protected virtual string GetVirtualDirectoryPath () { return _TreeView.PublishFolder; }
		

		protected abstract GenericTreeView GetTreeView ();
		

		protected abstract Label GetLabelTitle ();


		protected virtual string [] GetExcludedExtensions ()
		{
			return _TreeView.ExcludedExtensions;
		}


		protected virtual string GetExtensionFilter () { return "*.*"; }

		
		protected void Page_Load(object sender, EventArgs e)
		{
			_TreeView = GetTreeView ();

			_TreeView.IncludeHyperLinks = true;

			_TreeView.SelectNodeGetChildren += _TreeView.treeView_SelectNodeGetChildren;

			ScriptManager.GetCurrent (this).RegisterAsyncPostBackControl (_TreeView);
			
			if (!IsPostBack)
			{
				GetLabelTitle ().Text = Title;
				
				_TreeView.Browse ();
			}
		}
		
	}
}
